import { RawCommands } from '@valuation/core';

declare module '@valuation/core' {
  interface Commands<ReturnType> {
    hello: {

      hello: () => Promise<ReturnType> ;
    };
    hello1: {

      hello1: () => Promise<ReturnType> ;
    };
  }
}

export const hello: RawCommands['hello'] = async () => {
  console.log('hello start');
  return async ({ tr, editor, chain }) => {
    await tr.asyncTransaction(() => {
      tr.setNodeAttribute('1', { isCostDe: 100 });
      tr.addNodeMark('1', editor.schema.marks.color.create());
    });
    console.log('hello end');
    await chain().hello1();
  };
};
export const hello1: RawCommands['hello1'] = async () => {
  return async () => {
    console.log('hello1');
  };
};
